package com.itheima_09.StringBuilder;

public class Test02 {
    public static void main(String[] args) {
        int[] arr = {1,2,3};
        String s = arrMethod(arr);
        System.out.println(s);
    }
    public static String arrMethod(int[] arr){
        StringBuilder s = new StringBuilder();
        s.append("[");
        for(int i = 0; i < arr.length ; i++){
            if(i == arr.length -1){
                s.append(arr[i]).append("]");
            }else{
                s.append(arr[i]).append(",");
            }
        }
        String s1 = s.toString();
        return s1;
    }
}
